Backlink: reference-notes-readme


Upgrading with just Bash

This will allow us to upgrade to a TTY terminal without relying on Python or any other dependencies. Works on most Linux installs. It will give a TTY terminal capable of running sudo, entering passwords at prompts etc., but control characters like ctrl+z, arrow up through command history, or arrow left/right within a single line still won't work.

/usr/bin/script -qc /bin/bash /dev/null

Spawn PTY w/Python, Upgrade w/magic

This will allow you to run su, in addition to giving you a nicer prompt. It will not give you tab-completion or history. We then upgrade with stty magic to obtain these things.

python -c 'import pty; pty.spawn("/bin/bash")'
# Ctrl-Z
stty raw -echo; fg; reset;
reset
term=xterm-256color

If the terminal on the Kali host does not respond after closing the shell, type reset then hit Enter. The terminal should reset, you just won't see the text as you type.

Using socat

socat file:`tty`,raw.echo-0 tcp-listen:12345